Problem Note 33288: PROC SURVEYMEANS computes incorrect degrees of freedom if the same variable is used on both the STRATA and DOMAIN statements
If the same variable is specified on both the STRATA and DOMAIN statements in PROC SURVEYMEANS, the degrees of freedom and related statistics will be incorrect for any domain analysis involving that variable. The affected statistics are the degrees of freedom, the p-value for the t-test, and all of the confidence limits. The following is a list of the keywords for these statistics:
CLM
CLSUM
DF
LCLM
LCLSUM
T
UCLM
UCLSUM
The degrees of freedom are being computed as the number of PSU’s in the current stratum minus the total number of strata. The correct df computation in the domain analysis is the total number of PSU’s minus the total number of strata.
To circumvent this problem, create a new domain variable that is equal to the stratum variable and use the new variable in the DOMAIN statement. For example:
data a;
input s y;
datalines;
1 1
1 2
1 4
2 3
2 5
2 8
;
run;
title 'Incorrect df and related stats in domain analysis';
proc surveymeans all;
strata s;
var y;
domain s;
run;
title 'Circumvention and Correct domain analysis';
data a;
set a;
d=s;
run;
proc surveymeans all;
strata s;
var y;
domain d;
run;
Operating System and Release Information
SAS System | SAS/STAT | Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | 9.2 TS2M0 |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | 9.2 TS2M0 |
Microsoft Windows XP Professional | 9.1 TS1M0 | 9.2 TS2M0 |
64-bit Enabled AIX | 9.1 TS1M0 | 9.2 TS2M0 |
64-bit Enabled HP-UX | 9.1 TS1M0 | 9.2 TS2M0 |
64-bit Enabled Solaris | 9.1 TS1M0 | 9.2 TS2M0 |
HP-UX IPF | 9.1 TS1M0 | 9.2 TS2M0 |
Linux | 9.1 TS1M0 | 9.2 TS2M0 |
OpenVMS Alpha | 9.1 TS1M0 | 9.2 TS2M0 |
Tru64 UNIX | 9.1 TS1M0 | 9.2 TS2M0 |
Microsoft Windows NT Workstation | 9.1 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | 9.2 TS2M0 |
z/OS | 9.1 TS1M0 | 9.2 TS2M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Problem Note |
Priority: | alert |
Topic: | Analytics ==> Survey Sampling and Analysis SAS Reference ==> Procedures ==> SURVEYMEANS
|
Date Modified: | 2011-12-14 14:04:31 |
Date Created: | 2008-09-15 10:22:17 |